<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<h1>留言板</h1>
<?php

include("conn.php");

?>

<?php
$sql = "SELECT * FROM  message";
$result = $conn->query($sql);

$arrlist = array();

if ($result->num_rows > 0) {  
    // 输出每行数据
    while($row = $result->fetch_assoc()) {
        array_push($arrlist, $row);        
    }
} else {
    echo "0 results";
}

$conn->close();     
?>
<style type="text/css">
<!--
body,td,th{
	font-size: 12px;
	background-color: #669;
	background-image: url(image/74f7f3d3b1c90533960a16a3.jpg.gif);
	background-repeat: no-repeat;
	background-position: 450px 200px;
}
h1{ text-align: center; }
 
</style>
<?php
foreach ($arrlist as $vo){
?>
<table width="1007" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">

<tr>
    <td width="124" height="30" align="center" bgcolor="#FFFFFF"><?php echo ($vo["usename"]) ?></td>
    <td width="880" align="left" bgcolor="#FFFFFF"> 　<?php echo $vo["email"] ?>

        <a href="add.php">添加留言</a> <a href="detail.php?id=<?php echo $vo['id']; ?>">查看留言</a> <a href="login.php">登陆</a></td>
</tr>
<tr>
    <td height="29" bgcolor="#FFFFFF"></td>
    <td align="left" bgcolor="#FFFFFF">　<?php echo ($vo["content"]) ?></td>
</tr>
</table><br>
<?php
}
?>

